import 'package:daoyi_ui_admin_getx/app/common/utils/common_toast_util.dart';
import 'package:daoyi_ui_admin_getx/app/routes/app_pages.dart';
import 'package:daoyi_ui_admin_getx/generated/locales.g.dart';
import 'package:flutter/material.dart';

import 'package:get/get.dart';

import 'setting_page_controller.dart';

class SettingPageView extends GetView<SettingPageController> {
  const SettingPageView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(LocaleKeys.pages_setting_title.tr),
      ),
      body: SafeArea(
        child: ListView(
          padding: const EdgeInsets.all(10),
          children: [
            ElevatedButton(
              onPressed: () {
                Get.isDarkMode?Get.changeThemeMode(ThemeMode.light):Get.changeThemeMode(ThemeMode.dark);
              },
              child: Text(LocaleKeys.buttons_change_theme.tr),
            ),
            ElevatedButton(
              onPressed: () {
                // Get.offAllNamed(Routes.LOGIN);
                CommonToastUtil.showToast("已经退出登录");
              },
              child: Text(LocaleKeys.buttons_logout.tr),
            ),
          ],
        ),
      ),
    );
  }
}
